package com.yanqu.xiuxian.crosssystem.manger.elementalbonds.entity;

import com.yanqu.xiuxian.db.MongoData;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Objects;

@Document(collection = "elemental_bonds_rank")
public class ElementalBondsRankData extends MongoData {
    private long playerId;
    private long serverId;
    private long score;
    private long updateTime;
    private long groupId;
    private long rewardTime;
    private boolean isRobot;

    private int headIcon;
    private String name;

    public ElementalBondsRankData() {
    }

    public ElementalBondsRankData(long playerId, long score, long serverId, long updateTime, long groupId) {
        this.playerId = playerId;
        this.serverId = serverId;
        this.score = score;
        this.updateTime = updateTime;
        this.groupId = groupId;
        this.isRobot = false;
        setChangeState();
    }

    public ElementalBondsRankData(long playerId, String name, int headIcon, boolean isRobot, long rewardTime, long groupId, long updateTime, long score, long serverId) {
        this.playerId = playerId;
        this.name = name;
        this.headIcon = headIcon;
        this.isRobot = isRobot;
        this.rewardTime = rewardTime;
        this.groupId = groupId;
        this.updateTime = updateTime;
        this.score = score;
        this.serverId = serverId;
        setChangeState();
    }

    public long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(long playerId) {
        if (!Objects.equals(this.playerId, playerId)) {
            this.playerId = playerId;
            setChangeState();
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if (!Objects.equals(this.serverId, serverId)) {
            this.serverId = serverId;
            setChangeState();
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (!Objects.equals(this.score, score)) {
            this.score = score;
            setChangeState();
        }
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        if (!Objects.equals(this.updateTime, updateTime)) {
            this.updateTime = updateTime;
            setChangeState();
        }
    }

    public long getGroupId() {
        return groupId;
    }

    public void setGroupId(long groupId) {
        if (!Objects.equals(this.groupId, groupId)) {
            this.groupId = groupId;
            setChangeState();
        }
    }

    public long getRewardTime() {
        return rewardTime;
    }

    public void setRewardTime(long rewardTime) {
        if (!Objects.equals(this.rewardTime, rewardTime)) {
            this.rewardTime = rewardTime;
            setChangeState();
        }
    }

    public boolean isRobot() {
        return isRobot;
    }

    public void setRobot(boolean robot) {
    }

    public int getHeadIcon() {
        return headIcon;
    }

    public void setHeadIcon(int headIcon) {
        if (!Objects.equals(this.headIcon, headIcon)) {
            this.headIcon = headIcon;
            setChangeState();
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if (!Objects.equals(this.name, name)) {
            this.name = name;
            setChangeState();
        }
    }
}
